package com.beck.bee.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by sakawijaya on 3/15/2017.
 */

@Controller
public class HelloWorldRestController {

    private final Logger logger = LogManager.getLogger(getClass());

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public @ResponseBody String welcome() { //Welcome page, non-rest
        logger.error("log error");
        logger.info("log info");
        logger.debug("log debug");
        return "Welcome to RestTemplate Example";
    }

    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index() {
        return "index";
    }

}
